/*
 * IntervalTimer.java
 * Implements a TimerTaks that periodically updates the drawing.
 *
 * Copyright 2009 by Miguel Moreto.
 * You may use or distribute this code under the terms of the GPL.
 *
 * $Rev: 54 $
 * $LastChangedDate: 2009-07-15 14:22:06 +0000 (Wed, 15 Jul 2009) $
 */

package Main;

import java.util.*;


/**
 *
 * @author moreto
 */
public class IntervalTimer extends TimerTask {
    private ResultCanvas canvas;
    private long intervalMilliseconds;

    public IntervalTimer (long i){
        intervalMilliseconds = i;
    }

    public void setCanvas(ResultCanvas c){
        canvas = c;
    }

    public void run(){
        canvas.incrementDate(intervalMilliseconds);
        //canvas.setDate(timeMilliseconds + timeCounter);
        //timeCounter = timeCounter + intervalMilliseconds;
        canvas.updateCanvas();
    }

}
